Skip to content

fix(watchdog): re-escalate at the second threshold instead of deduping into silence (#10630) - #12965

Merged
dezren39 merged 1 commit into
mainfrom
lane-gf/10630-reescalation
Nov 23, 2026
Merged

dezren39 merged 1 commit into
mainfrom
lane-gf/10630-reescalation

Conversation

@dezren39

@dezren39 dezren39 commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

Next slice of #10630 (does NOT close it): the code-owned watchdog half of acceptance criterion 3 — "simulated dead scrape with repair task ignored: escalation re-fires at the second threshold."

Before: a confirmed rung-4 hand-off deduped forever. If nobody picked up the repair task, the incident issue went silent; the only second-threshold artifact was the NEEDS DREW log line from surfacingLine.

Now:

  • planEscalation(health, ctx, nowMs?) — with a clock, a fully confirmed hand-off that has been unresolved for ESCALATION_REPEAT_AFTER_MS (24h, matching the surfacing threshold) plans exactly one comment_issue on the existing incident issue ("Still unresolved … repair task remains the work item"). No new issue, no new task — the update lands on the existing escalation, per (source, failure class).
  • The plan is flagged reEscalated; the watchdog entry point stamps it via the new recordReEscalation once the comment confirms. The stamp (lastReEscalatedAt on EscalationRecord, preserved by coerceHealth, including on displaced previous records) restarts the window: one re-escalation per window, never one per tick, and never silence.
  • Without a clock, planner behavior is byte-for-byte the old dedupe (existing callers/tests unaffected). Partial hand-offs still plan only their missing creations, even past the window.

Verification (laptop worktree off origin/main): bun test over watchdog-escalation.test.ts + watchdog-state.test.ts + watchdog.test.ts — 46 pass / 0 fail, including 7 new tests whose oracle is #10630 acceptance 3 (dedupe before the window, single comment at the threshold, per-window repeat, displaced-record stamping, coercion round-trip).

Remaining on #10630: the CDP wedge probe and the Mistral gatherer failure classification (session-expired vs cdp-unavailable) — the gatherer side is OpenChamber-side per the 2026-11-22 decision recorded on the issue, so it is not in this repo's slice.


Show it working
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

…g into silence (#10630)

A confirmed rung-4 hand-off deduped forever: if the repair task was
never picked up, the incident issue went quiet and only the 24h
surfacing log line ever fired. planEscalation now takes the tick
clock and, once a fully confirmed hand-off has been unresolved for
ESCALATION_REPEAT_AFTER_MS (24h, the second threshold), plans a
single re-escalation comment on the EXISTING incident issue — no new
issue, no new task — flagged reEscalated so the entry point stamps
it via the new recordReEscalation. The stamp (lastReEscalatedAt on
EscalationRecord, preserved by coerceHealth) restarts the window, so
re-escalation fires once per window while the source stays down.

Oracle: #10630 acceptance 3 (dead scrape, repair task ignored,
escalation re-fires at the second threshold) + the #6033 dedupe
contract. 7 new tests in watchdog-escalation.test.ts; all 46 tests
across the three watchdog suites pass.
@coderabbitai

coderabbitai Bot commented Nov 23, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 45 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: fe4bf81d-a979-4986-b439-4a99fba0e863
Commits

Reviewing files that changed from the base of the PR and between ec27127 and a23e99c.

Files selected for processing: 4

  • pm-stack/exporters/src/watchdog-escalation.ts
  • pm-stack/exporters/src/watchdog-state.ts
  • pm-stack/exporters/src/watchdog.ts
  • pm-stack/exporters/test/watchdog-escalation.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-23T06:01:46.051365Z a23e99c PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant